package com.salim.summary.design.$2abstractFactory;


public class PlaneFactory extends AbstractVehicleFactory{
    @Override
    public Car getCar(String type) {
        return null;
    }

    @Override
    public Plane getPlane(String type){
        if(type.equals("big")){
            return new BigPlane();
        }else if(type.equals("small")){
            return new SmallPlane();
        }
        return null;
    }
    public static void main(String[] args){
        PlaneFactory planeFactory = new PlaneFactory();
        planeFactory.getPlane("big").fly();
        planeFactory.getPlane("small").fly();
    }
}
class BigPlane implements Plane{
    @Override
    public void fly() {
        System.out.println("big");
    }
}

class SmallPlane implements Plane{
    @Override
    public void fly() {
        System.out.println("small");
    }
}

